home *** CD-ROM | disk | FTP | other *** search
ARB Fragment shader | 2004-01-22 | 686 b | 20 lines |
- !!ARBfp1.0
- ATTRIB extinction = fragment.color.primary;
- ATTRIB inscattering = fragment.color.secondary;
-
- PARAM USEFUL = {0.0, 0.5, 1.0, 2.0};
-
- ATTRIB litcolor = fragment.texcoord[2];
-
- TEMP terrain, clouds;
-
- TEX terrain, fragment.texcoord[0], texture[0], 2D;
- TEX clouds, fragment.texcoord[1], texture[1], 2D;
-
- MUL terrain.rgb, terrain, litcolor; # Vertex color * terrain texture
- MAD clouds, clouds, -USEFUL.y, USEFUL.z; # clouds = 1-0.5*clouds
- MUL terrain, terrain, clouds;
- MUL terrain, terrain, extinction; # Apply extinction
- ADD result.color, terrain, inscattering; # Final color with added inscattering
- END
-